import { SettingsModel } from 'server/models/Settings'

export default defineEventHandler(async (event) => {
  try {
    const footerQuickLinks = await SettingsModel.getGroupedSettings('footer_quick_links')
    
    if (!footerQuickLinks || Object.keys(footerQuickLinks).length === 0) {
      return {
        success: false,
        message: 'Footer快速链接信息不存在',
        data: null
      }
    }

    return {
      success: true,
      message: '获取Footer快速链接信息成功',
      data: footerQuickLinks
    }
  } catch (error: any) {
    console.error('获取Footer快速链接信息失败:', error)
    
    return {
      success: false,
      message: `获取Footer快速链接信息失败: ${error.message}`,
      data: null
    }
  }
})